<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<div id="item-list">
	<table>
		<thead>
			<tr>
				<th>ID</th>
				<th>Name</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${items}" var="item" varStatus="status">
				<tr class="${(status.count % 2 == 0) ? 'even' : 'odd'}${status.last ? ' last' : ''}">
					<td><a href="preview/${item.inventaryNumber.value}">${item.inventaryNumber.value}</a></td>
					<td><a href="preview/${item.inventaryNumber.value}">${item.subject.value}</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<c:choose>
		<c:when test="${not empty user}">
			<a href="insert">New item</a>
		</c:when>
	</c:choose>
	
</div>